// ==================================================================================
// Shared Genomics Project MPI Codebase
// Version 1.0 30/04/2010
//
// (c) 2010 University of Manchester all rights reserved
//
// This file is distributed under the GNU General Public License, Version 2.  
// Please see the file COPYING.txt for more details
// ==================================================================================

#ifndef _CONVERT_H_
#define _CONVERT_H_

#include "mapfile.h"
#include "pedfile.h"

#ifdef __cplusplus
extern "C" {
#endif

/*!
\file
\ingroup	gio
\brief		Data conversion routines
\details	
	This header file once had more functions but these have been merged with other source
	files in the I/O library.
\bug Merge the remaining functions with other I/O library headers.
*/

/*! 
\brief Convert a SNP-major data-set to Person-Major.
\details
	Basically SNP x Person data-set goes to Person x SNP by 
	transferring data from \ref csnp::one and \ref csnp::two
	to \ref individual::one and \ref individual::two .<br>
	Be warned as both source and destination arrays are placed in memory for the
	array rotation, this method can use a lot of storage space.<br>
	After the rotation, the csnp::one and \ref csnp::two arrays of 
	each SNP are de-allocated and the appropriate size counters zeroed.
\param [in, out] map Source SNP-Major data-set
\param [in, out] ped Destination Person-Major data-set.
\returns 1 on success or -1 on failure.
*/
int snp_to_ind(struct mapfile *map, struct pedfile *ped);

#ifdef __cplusplus
}
#endif

#endif // _CONVERT_H_
